package com.ruoyi.demo.zbus;

import com.ruoyi.demo.service.ITodoService;
import io.zbus.rpc.RpcProcessor;
import io.zbus.rpc.RpcServer;
import org.springframework.stereotype.Component;

/**
 * ruoyi
 * Description: //TODO
 *
 * @author lucas <link>mailto:lucas.shao@foxmail.com</link>
 * @since 2019-06-17
 */
@Component
public class RpcServerAgent {
	private RpcProcessor rpcProcessor = new RpcProcessor();
	private RpcServer rpcServer = new RpcServer();

	public RpcServerAgent(ITodoService todoService) {
		rpcProcessor.mount("/", todoService);

		rpcServer.setMqServerAddress("192.168.0.241:15555");
		rpcServer.setRpcProcessor(rpcProcessor);
		rpcServer.setMq("/");
		rpcServer.start();
	}
}
